#!/bin/sh

echo "test curl zlip support ================================"
curl --compressed http://dns.weixin.qq.com/cgi-bin/micromsg-bin/newgetdns

sleep 1
wdctl status

sleep 1
echo "wdctl clear_trusted_domains ==========="
wdctl clear_trusted_domains

sleep 1
echo "wdctl add_trusted_domains www.baidu.com ======"
wdctl add_trusted_domains www.baidu.com
wdctl show_trusted_domains

sleep 1
echo "wdctl clear_trusted_domains ==========="
wdctl clear_trusted_domains
wdctl show_trusted_domains

sleep 1
echo "wdctl add_trusted_domains www.baidu.com,www.qq.com,www.360.cn,www.163.com,www.sohu.com ====="
wdctl add_trusted_domains www.baidu.com,www.qq.com,www.360.cn,www.163.com,www.sohu.com
wdctl show_trusted_domains

sleep 1
echo "wdctl del_trusted_domains www.baidu.com"
wdctl del_trusted_domains www.baidu.com
wdctl show_trusted_domains

sleep 1
echo "wdctl del_trusted_domains www.qq.com,www.163.com"
wdctl del_trusted_domains www.qq.com,www.163.com
wdctl show_trusted_domains

sleep 1
echo "wdctl clear_trusted_domains ==========="
wdctl clear_trusted_domains
wdctl show_trusted_domains

sleep 1
echo "wdctl add_trusted_iplist 192.168.1.1 =============="
wdctl add_trusted_iplist 192.168.1.1
wdctl show_trusted_domains
wdctl clear_trusted_iplist
wdctl show_trusted_domains

sleep 1
echo "wdctl add_trusted_iplist 192.2.3.3,3.3.3.3,4.4.4.4 ==============="
wdctl add_trusted_iplist 192.2.3.3,3.3.3.3,4.4.4.4
wdctl show_trusted_domains
wdctl clear_trusted_iplist
wdctl show_trusted_domains

sleep 1
echo "wdctl add_trusted_domains www.baidu.com,www.qq.com,www.360.cn,www.163.com,www.sohu.com ====="
wdctl add_trusted_domains www.baidu.com,www.qq.com,www.360.cn,www.sohu.com
wdctl show_trusted_domains

sleep 1
echo "wdctl add_trusted_iplist 192.168.1.1 =============="
wdctl add_trusted_iplist 192.168.1.1
wdctl show_trusted_domains
wdctl clear_trusted_iplist

sleep 1
echo "wdctl add_trusted_iplist 192.2.3.3,3.3.3.3,4.4.4.4 ==============="
wdctl add_trusted_iplist 192.2.3.3,3.3.3.3,4.4.4.4
wdctl show_trusted_domains
wdctl clear_trusted_iplist
wdctl clear_trusted_domains

sleep 1
echo "wdctl add_trusted_iplist 192.2.3.3,3.3.3.3,4.4.4.4  && wdctl user_cfg_save ==============="
wdctl add_trusted_iplist 192.2.3.3,3.3.3.3,4.4.4.4
wdctl show_trusted_domains
wdctl user_cfg_save
cat /etc/config/wifidog

sleep 1
echo "wdctl clear_trusted_iplist && wdctl user_cfg_save"
wdctl clear_trusted_iplist
wdctl user_cfg_save
cat /etc/config/wifidog

sleep 1
echo "wdctl add_trusted_mac 11:22:33:44:55:66"
wdctl add_trusted_mac 11:22:33:44:55:66
wdctl show_trusted_mac
echo "del 11:22:33:44:55:66"
wdctl del_trusted_mac 11:22:33:44:55:66
wdctl show_trusted_mac
echo "add 66,67,68,69,70"
wdctl add_trusted_mac 11:22:33:44:55:66,11:22:33:44:55:67,11:22:33:44:55:68,11:22:33:44:55:69,11:22:33:44:55:70
wdctl show_trusted_mac
echo "del 66"
wdctl del_trusted_mac 11:22:33:44:55:66
wdctl show_trusted_mac
echo "del 67,68"
wdctl del_trusted_mac 11:22:33:44:55:67,11:22:33:44:55:68
wdctl show_trusted_mac
echo "save ..."
wdctl user_cfg_save
uci show wifidog
echo "clear ..."
wdctl clear_trusted_mac
wdctl show_trusted_mac
wdctl user_cfg_save
uci show wifidog

sleep 1
echo "wdctl add_untrusted_mac 11:22:33:44:55:66"
wdctl add_untrusted_mac 11:22:33:44:55:66
wdctl show_untrusted_mac
echo "del 11:22:33:44:55:66"
wdctl del_untrusted_mac 11:22:33:44:55:66
wdctl show_untrusted_mac
echo "add 66,67,68,69,70"
wdctl add_untrusted_mac 11:22:33:44:55:66,11:22:33:44:55:67,11:22:33:44:55:68,11:22:33:44:55:69,11:22:33:44:55:70
wdctl show_untrusted_mac
echo "del 66"
wdctl del_untrusted_mac 11:22:33:44:55:66
wdctl show_untrusted_mac
echo "del 67,68"
wdctl del_untrusted_mac 11:22:33:44:55:67,11:22:33:44:55:68
wdctl show_untrusted_mac
echo "save ..."
wdctl user_cfg_save
uci show wifidog
echo "clear ..."
wdctl clear_untrusted_mac
wdctl show_untrusted_mac
wdctl user_cfg_save
uci show wifidog
